﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.YG
{
    /// <summary>
    /// 阳光人寿附加金色阳光住院津贴医疗保险条款
    /// </summary>
    class Class15
    {
        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("住院"))
            {
                int x=(int)ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("住院天数");

                x=x>180?180:x;

                da.Value = ppa.Amount * 50 * x;

                da.Description = "一次以90天为限，一年最多180天";
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("重大疾病住院"))
            {
                ppa.SchemePeriodActing.InsurantStates.Add("重大疾病");
                ppa.SchemePeriodActing.InsurantStates.Add("住院");

                int x = (int)ppa.SchemePeriodActing.SchemeActing.GetAuxConfigValue("重大疾病住院天数");

                x = x > 30 ? 30 : x;

                da.Value = ppa.Amount * 50 * x;

                da.Description = "一年最多30天";
            }
        }

        public void Calc1(IPolicyPeriodActing ppa, IDutyActing da)
        {
            if (ppa.SchemePeriodActing.InsurantStates.Contains("紧急救护车使用"))
            {
                da.Value = ppa.Amount * 50;
            }
        }
    }
}
